package com.tech.service.impl;

import com.tech.dao.AccountDaoInterface;
import com.tech.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

@Service("accountService")
public class AccountServiceImpl implements AccountService {

    @Autowired
    private AccountDaoInterface account;

    @Transactional()
    public void transferMoney(String outMan, String inMan, double money) {
        account.out(outMan,money);
//        int i = 1 / 0;
        account.in(inMan,money);
    }

}
